package com.itmoment.service.impl;

import com.itmoment.User;
import com.itmoment.dao.UserDao;
import com.itmoment.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional    //spring声明式事务注解.配置中要创建事务管理器,开启事务注解支持.
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }
}
